package com.sharemarking.wa.platform.config;

import cn.jiguang.common.ClientConfig;
import cn.jpush.api.JPushClient;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;


import javax.annotation.PostConstruct;

/**
 * @author dxy
 */
@Configuration
public class JGPushConfig {
    @Value("${jgpush.masterSecret}")
    private String MASTER_SECRET;
    @Value("${jgpush.appkey}")
    private String APP_KEY;

    private JPushClient jpushClient;

    @PostConstruct
    public void initJPushClient() {
        jpushClient = new JPushClient(MASTER_SECRET, APP_KEY, null, ClientConfig.getInstance());
    }

    public JPushClient getJPushClient() {
        return jpushClient;
    }

}
